package com.kly.sc.api.application.controller.user.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

/**
 * 用户行为接口请求类
 * @author linqu
 */
public class SetNewFlagRequest extends ParamsObject {

    /**
     * 用户内码
     */
    private String userCodeFriend;
    /**
     * 用户操作：1 拉黑  2取消拉黑 3隐藏  4举报
     */
    private Integer newFlag;

    public String getUserCodeFriend() {
        return userCodeFriend;
    }

    public void setUserCodeFriend(String userCodeFriend) {
        this.userCodeFriend = userCodeFriend;
    }

    public Integer getNewFlag() {
        return newFlag;
    }

    public void setNewFlag(Integer newFlag) {
        this.newFlag = newFlag;
    }

    @Override
    public void validate() {
        if (StringUtils.isBlank(this.userCodeFriend)) {
            throw new ApplicationException(RestCodeEnum.USERID_NOT_EXIST_ERROR);
        }
        if (Objects.isNull(this.newFlag)) {
            throw new ApplicationException(RestCodeEnum.SYSTEM_PARAMETER_ERROR);
        }

    }
}
